<?php
$title="Category List";
$css="classifyList.css";
include_once 'common/AdminTop.php';
include_once 'authentic.php';
include_once '../Class/DB.php';
$db=new DB();
$b_class=$db->get_parent_types(0);
?>
<script src="../js/classifyList.js" type="text/javascript"></script>
<div id="userlist" align="center">
<table id="userlistTable" border="1" style="margin-top:20px;font-size: 12px;">
	<tbody>
		<tr style="color:white;height: 25px;">
			<th width=""><p>No</p></th>
			<th width="80px"><p>Name</p></th>
			<th width="120px"><p>Modify</p></th>
			<th width=""><p></p></th>
		</tr>
		<?php 
		$i=0;
		while(isset($b_class[$i]))
		{
		?>
		<tr style="color:white;height:30px;">
			<td align="center"><p><?php echo $i+1;?></p></td>
			<td width="" align="center"><p id="a_<?php echo $b_class[$i]["tid"];?>"><a href="s_classesList.php?id=<?php echo $b_class[$i]["tid"];?>"><?php echo $b_class[$i]["name"];?></a></p><input type="text" style="width:70px;display: none;" id="input_<?php echo $b_class[$i]["tid"];?>" name="name_<?php echo $b_class[$i]["tid"];?>"></td>	
			<td width="" align="center">
			<input id="modify_<?php echo $b_class[$i]["tid"];?>" type="button" name="modifyname" value="Modify" onclick="onmodify(<?php echo $b_class[$i]["tid"];?>,'<?php echo $b_class[$i]["name"];?>');"/>
			<input id="save_<?php echo $b_class[$i]["tid"];?>" type="button" style="display: none;" name="savename" value="Save" onclick="onsave(<?php echo $b_class[$i]["tid"];?>);"/>
			<input id="cancel_<?php echo $b_class[$i]["tid"];?>" type="button" style="display: none;" name="cancel" value="Cancel" onclick="oncancel(<?php echo $b_class[$i]["tid"];?>);"/>
			</td>
			<td width="" align="center"><p><a href="classDelete.php?id=<?php echo $b_class[$i]["tid"];?>">
				<img alt="x" src="../image/delete.png" width="14">
			</a></p></td>	
		</tr>
		<?php 
		$i++;
		}
		?>
	</tbody>
</table>
<br>
<input type="button" name="addBtn" value="Add Type" onclick="onAdd();"/>
</div>
<br><br>
<?php 
include_once 'common/AdminTail.php';
?>